#include "CNetMgr.hpp"
#define SERPORT 10086
#define FLAG 1024

CNetMgr::CNetMgr()
{
	 m_serAddr.sin_family = AF_INET;;
	 m_serAddr.sin_port = SERPORT;
	 m_serAddr.sin_addr.s_addr = ADDRANARY;
}

void CNetMgr::setTCP()
{
     m_mode = TCP_TYPE;
}

void CNetMgr::setUDP()
{
     m_mode = UDP_TYPE;
}

void CNetMgr::setICMP()
{
     m_mode = ICMP_TYPE;
}

bool CNetMgr::init()
{
     
     if(m_serFd = socket(AF_INET, SOCK_STREAM, 0) < 0)
	 {
	       std::cout << "[CNetMgr::init] socket filaur!\n";
	 }
	 
	 if(bind(m_serFd, m_serAddr, sizeof(m_serAddr)) < 0)
	 {
	     std::cout << "[CNetMgr::init] bind filaur!\n";
	 }
	 
	 if(listen(m_serFd, FLAG) < 0)
	 {
	     std::cout << "[CNetMgr::init] listen filaur!\n";
	 }
}
void CNetMgr::acceptEndPonit()
{
      event[]
      epoll_creat();
}















